<template>
  <div class="homes">
    <van-card v-for="item in shopList" :key="item.id"
      num="2"
      :price="item.price"
      :desc="item.content"
      :title="item.title"
      :thumb="item.image"
      @click="handleDetail(item.id)"
    />
  </div>
</template>

<script>
import {mapActions,mapState} from 'vuex'
export default {
  created(){
   this.getShoplist()
  },
  computed:{
     ...mapState(['shopList'])
  },
  methods:{
    ...mapActions(['getShoplist']),
    handleDetail(id){
       this.$router.push(`/detail/${id}`)
    }
  },

}
</script>

<style scoped lang='scss'>
.homes{
  width: 100%;
  height: 100%;
  overflow-y: scroll;

}

</style>